package com.ruoyi.teacher.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teacher.mapper.TTrainMapper;
import com.ruoyi.teacher.domain.TTrain;
import com.ruoyi.teacher.service.ITTrainService;

/**
 * 培训情况Service业务层处理
 * 
 * @author xiangzy
 * @date 2022-05-08
 */
@Service
public class TTrainServiceImpl implements ITTrainService 
{
    @Autowired
    private TTrainMapper tTrainMapper;

    /**
     * 查询培训情况
     * 
     * @param recordid 培训情况ID
     * @return 培训情况
     */
    @Override
    public TTrain selectTTrainById(Long recordid)
    {
        return tTrainMapper.selectTTrainById(recordid);
    }

    /**
     * 查询培训情况列表
     * 
     * @param tTrain 培训情况
     * @return 培训情况
     */
    @Override
    public List<TTrain> selectTTrainList(TTrain tTrain)
    {
        return tTrainMapper.selectTTrainList(tTrain);
    }

    /**
     * 新增培训情况
     * 
     * @param tTrain 培训情况
     * @return 结果
     */
    @Override
    public int insertTTrain(TTrain tTrain)
    {
        tTrain.setCreateTime(DateUtils.getNowDate());
        return tTrainMapper.insertTTrain(tTrain);
    }

    /**
     * 修改培训情况
     * 
     * @param tTrain 培训情况
     * @return 结果
     */
    @Override
    public int updateTTrain(TTrain tTrain)
    {
        tTrain.setUpdateTime(DateUtils.getNowDate());
        return tTrainMapper.updateTTrain(tTrain);
    }

    /**
     * 批量删除培训情况
     * 
     * @param recordids 需要删除的培训情况ID
     * @return 结果
     */
    @Override
    public int deleteTTrainByIds(Long[] recordids)
    {
        return tTrainMapper.deleteTTrainByIds(recordids);
    }

    /**
     * 删除培训情况信息
     * 
     * @param recordid 培训情况ID
     * @return 结果
     */
    @Override
    public int deleteTTrainById(Long recordid)
    {
        return tTrainMapper.deleteTTrainById(recordid);
    }
}
